package Vista;
import Imagenes.JBtnEstandar;

import java.awt.BorderLayout;
import java.awt.event.ActionListener;

import javabean.JPanelImagen;

import javax.swing.BorderFactory;
import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.JTextArea;
import javax.swing.JTextField;

import javax.swing.WindowConstants;
import javax.swing.border.BevelBorder;
import javax.swing.border.LineBorder;
import javax.swing.border.SoftBevelBorder;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import javax.swing.SwingUtilities;

import bean.JTablePlus;
import bean.JTextFieldValidator;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class formConsultarPlanteamiento extends javax.swing.JFrame {
//	private JPanel pnDatos;
	private JPanelImagen pnConsulta;
	private JBtnEstandar btBuscarP;
	private JBtnEstandar btBuscar;
	private JBtnEstandar btEliminar;
	private JBtnEstandar btModificar;
	private JBtnEstandar btCancelar;
	private JBtnEstandar btSalir;
	private JTextArea txtAPlanteamiento;
	private JLabel btPlanteamiento;
	private JTablePlus tbPlanteamientos;
	private JComboBox cmbPlantemientos;
	private JLabel lbPlanteamiento;
	private JOptionPane mensaje;

	/**
	* Auto-generated main method to display this JFrame
	*/
		
	public formConsultarPlanteamiento() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			this.setResizable(false);
				{
				pnConsulta = new JPanelImagen();
				getContentPane().add(pnConsulta, BorderLayout.CENTER);
					pnConsulta.setRutaImagen("/Imagenes/Principal.jpeg");
					pnConsulta.setPreferredSize(new java.awt.Dimension(505, 499));
					{
						lbPlanteamiento = new JLabel();
						pnConsulta.add(lbPlanteamiento);
						lbPlanteamiento.setText("Planteamientos");
						lbPlanteamiento.setBounds(42, 26, 98, 15);
					}
					{
						ComboBoxModel cmbPlantemientosModel = 
							new DefaultComboBoxModel(
									new String[] { "Solicitud", "Sugerencia","Idea" });
						cmbPlantemientos = new JComboBox();
						pnConsulta.add(getCmbPlantemientos());
						cmbPlantemientos.setModel(cmbPlantemientosModel);
						cmbPlantemientos.setBounds(140, 22, 163, 22);
						cmbPlantemientos.setFont(new java.awt.Font("Bitstream Charter",2,12));
						cmbPlantemientos.setBackground(new java.awt.Color(255,255,255));
					}
					{
						String[][] filas = { { "Cedula", "Nombre","Tipo" }};
						String[] columnas = { "Cedula", "Nombre","Tipo"  };
						tbPlanteamientos = new JTablePlus(filas,columnas);
						pnConsulta.add(this.tbPlanteamientos);
						tbPlanteamientos.setBounds(42, 69, 330, 151);
						tbPlanteamientos.setBorder(BorderFactory.createTitledBorder(""));
					}
					{
						btPlanteamiento = new JLabel();
						pnConsulta.add(getBtPlanteamiento());
						btPlanteamiento.setText("Planteamiento");
						btPlanteamiento.setBounds(49, 239, 91, 15);
					}
					{
						txtAPlanteamiento = new JTextArea();
						pnConsulta.add(getTxtAPlanteamiento());
						txtAPlanteamiento.setBounds(42, 272, 330, 131);
						txtAPlanteamiento.setBorder(BorderFactory.createTitledBorder(""));
					}
					{
						btBuscar = new JBtnEstandar();
						pnConsulta.add(btBuscar);
						btBuscar.setText("Cargar");
						btBuscar.setBounds(292, 232, 80, 22);
					}
					{
						btSalir = new JBtnEstandar();
						pnConsulta.add(btSalir);
						btSalir.setText("Salir");
						btSalir.setBounds(305, 437, 90, 22);
					}
					{
						btCancelar = new JBtnEstandar();
						pnConsulta.add(btCancelar);
						btCancelar.setText("Cancelar");
						btCancelar.setBounds(206, 437, 90, 22);
					}
					{
						btModificar = new JBtnEstandar();
						pnConsulta.add(btModificar);
						btModificar.setText("Modificar");
						btModificar.setBounds(8, 437, 90, 22);
					}
					{
						btEliminar = new JBtnEstandar();
						pnConsulta.add(btEliminar);
						btEliminar.setText("Eliminar");
						btEliminar.setBounds(107, 437, 90, 22);
					}
					{
						btBuscarP = new JBtnEstandar();
						pnConsulta.add(btBuscarP);
						btBuscarP.setText("Ver");
						btBuscarP.setBounds(310, 22, 72, 22);
					}

			}
			pack();
			this.setSize(423, 514);

		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}
	
	public JPanel getPnRegistrarConsulta() {
		return pnConsulta;
	}
	
	public JComboBox getCmbPlantemientos() {
		return cmbPlantemientos;
	}
	
	public JTablePlus getTbPlanteamientos() {
		return tbPlanteamientos;
	}
	
	
	public JBtnEstandar getBtBuscar() {
		return btBuscar;
	}
	public JBtnEstandar getBtEliminar() {
		return btEliminar;
	}

	public JBtnEstandar getBtBuscarP() {
		return btBuscar;
	}
	public JLabel getBtPlanteamiento() {
		return btPlanteamiento;
	}
	
	public JTextArea getTxtAPlanteamiento() {
		return txtAPlanteamiento;
	}
	
	public JBtnEstandar getBtSalir() {
		return btSalir;
	}
	
	public JBtnEstandar getBtCancelar() {
		return btCancelar;
	}
	public JBtnEstandar getBtModificar(){
		return btModificar;
	}
	public JOptionPane getMensaje() {
		return mensaje;
	}
	public void AgregarEscuchadores (ActionListener escuchador){
		this.btBuscarP.addActionListener(escuchador);
		this.btBuscar.addActionListener(escuchador);
		this.btModificar.addActionListener(escuchador);
		this.btEliminar.addActionListener(escuchador);
		this.btCancelar.addActionListener(escuchador);
		this.btSalir.addActionListener(escuchador);
	}
	public void Cancelar(){
		this.txtAPlanteamiento.setText("");
		this.tbPlanteamientos.setEnabled(true);
		this.tbPlanteamientos.LimpiarTabla();
	}

}
